$(document).ready(function(){
			
	$("#select1 dd").click(function () {
		$(this).addClass("selected").siblings().removeClass("selected");
		if ($(this).hasClass("select-all")) {
			$("#selectA").remove();
		} else {
			var copyThisA = $(this).clone();
			if ($("#selectA").length > 0) {
				$("#selectA a").html($(this).text());
			} else {
				$(".select-result dl").append(copyThisA.attr("id", "selectA"));
				//这里刷新页面，进行数据请求
			}
		}
	});
	
	$("#select2 dd").click(function () {
		$(this).addClass("selected").siblings().removeClass("selected");
		if ($(this).hasClass("select-all")) {
			$("#selectB").remove();
		} else {
			var copyThisB = $(this).clone();
			if ($("#selectB").length > 0) {
				$("#selectB a").html($(this).text());
			} else {
				$(".select-result dl").append(copyThisB.attr("id", "selectB"));
				//这里刷新页面，进行数据请求
			}
		}
	});
	
	$("#select3 dd").click(function () {
		$(this).addClass("selected").siblings().removeClass("selected");
		if ($(this).hasClass("select-all")) {
			$("#selectC").remove();
		} else {
			var copyThisC = $(this).clone();
			if ($("#selectC").length > 0) {
				$("#selectC a").html($(this).text());
			} else {
				$(".select-result dl").append(copyThisC.attr("id", "selectC"));
				//这里刷新页面，进行数据请求
			}
		}
	});
	
	
	$("#selectA").live("click", function () {
		$(this).remove();
		$("#select1 .select-all").addClass("selected").siblings().removeClass("selected");
		//这里刷新页面，进行数据请求
	});
	
	$("#selectB").live("click", function () {
		$(this).remove();
		$("#select2 .select-all").addClass("selected").siblings().removeClass("selected");
		//这里刷新页面，进行数据请求
	});
	
	$("#selectC").live("click", function () {
		$(this).remove();
		$("#select3 .select-all").addClass("selected").siblings().removeClass("selected");
	});
	
	
	$(".select dd").live("click", function () {
		if ($(".select-result dd").length > 1) {
			$(".select-no").hide();
			//这里刷新页面，进行数据请求
			loadXMLDoc("www.baidu.com");
		} else {
			$(".select-no").show();
			//这里刷新页面，进行数据请求
			loadXMLDoc("www.baidu.com");
		}
	});
	
});

//异步请求
function loadXMLDoc(url)
{
	
	//模拟假数据
			var data=[{"name":"张一","time":"2017/1/2","address":"xxxx","describe":"啦啦啦啦绿"},
				  {"name":"张一","time":"2017/1/3","address":"xxxx","describe":"啦啦啦df啦"},
				  {"name":"张一","time":"2017/1/4","address":"xxxx","describe":"啦啦啦df啦"}
			];
			 myObj = JSON.parse(data);
			var str;
			alert();
			for(var i=0;i<data.length;++i)
			{
				alert();
				str+=
				"<div class='item'><div class>"+data[i].describe+"</div><div style='margin-top:20px'><span >报修时间："+data[i].time+"</span><span style='margin-left:40px'>报修人："+data[i].name+"</span><span style='margin-left:40px'>故障地址："+data[i].address+"</span> </div>  <div>问题描述："+data[i].describe+"的发生的发生的方法是打发斯蒂芬</div></div><hr />"
			}
       	 $("#container").html(str);
			
	/*var xmlhttp;
	if (window.XMLHttpRequest)
	{
		//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// IE6, IE5 浏览器执行代码
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			//document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
			//在这儿做解析
			xmlhttp.responseText;
			
			//模拟假数据
			var data=[{"name":"张一","time":"2017/1/2","address":"xxxx","describe":"啦啦啦啦绿"},
				  {"name":"张一","time":"2017/1/3","address":"xxxx","describe":"啦啦啦df啦"},
				  {"name":"张一","time":"2017/1/4","address":"xxxx","describe":"啦啦啦df啦"}
			];
			 myObj = JSON.parse(data);
			var str;
			for(var i=0;i<data.length;++i)
			{
				alert();
				str+=
				"<div class='item'><div class>"+data[i].describe+"</div><div style='margin-top:20px'><span >报修时间："+data[i].time+"</span><span style='margin-left:40px'>报修人："+data[i].name+"</span><span style='margin-left:40px'>故障地址："+data[i].address+"</span> </div>  <div>问题描述："+data[i].describe+"的发生的发生的方法是打发斯蒂芬</div></div><hr />"
			}
       	 $("#container").html(str);
			}
	}
	xmlhttp.open("GET",url,true);
	xmlhttp.send();*/
}
